import Layout from '../views/layout.vue'
// 懒加载
// 标签页二级组件
const Home = () => import('@/views/home/index.vue')
const Question = () => import('@/views/question/index.vue')
const Video = () => import('@/views/video/index.vue')
const UserChat = () => import('@/views/user/chat.vue')
// 其他一级组件
const UserEdit = () => import('@/views/user/edit.vue')
const Login = () => import('@/views/login/index.vue')
const Search = () => import('@/views/search/index.vue')
const SearchResult = () => import('@/views/search/result.vue')
const Article = () => import('@/views/article/index.vue')

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '/',
        name: 'Home',
        component: Home
      },
      {
        path: '/question',
        name: 'Question',
        component: Question
      },
      {
        path: '/video',
        name: 'Video',
        component: Video
      },
      {
        path: '/userchat',
        name: 'UserChat',
        component: UserChat
      }
    ]
  },
  {
    path: '/userEdit',
    name: 'UserEdit',
    component: UserEdit
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/search',
    name: 'Search',
    component: Search
  },
  {
    path: '/searchResult',
    name: 'SearchResult',
    component: SearchResult
  },
  {
    path: '/article',
    name: 'Article',
    component: Article
  }
]
export default routes
